public class TestRect02 {
    public static void main(String[] args) {
        //1、创建对象
        Rect rect = new Rect();
        rect.height = 10;
        rect.width = 10;
        System.out.println(rect.calArea());
        System.out.println(rect.calPerimeter());
    }
}

class Rect {
    int height;
    int width;

    public int calArea() {
        return height*width;
    }

    public int calPerimeter() {
        return (height+width)*2;
    }
}
